package com.qy127.dao.impl;

import com.qy127.dao.ResultDao;
import com.qy127.entity.Book;
import com.qy127.util.JDBCUtil;

import java.util.List;
import java.util.Map;

public class ResultDaoImpl implements ResultDao {
    @Override
    public int selCount() {
        String sql="select bookid from t_book";//根据id查所有数据
        List<List> lists = JDBCUtil.queryList(sql);
        int size = lists.size();//查询数量
        return size;
    }


    //查询所有的图书 list<Map> 类型
    @Override
    public List<Map> getBookAll() {
        String sql="select * from t_book";
        List<Map> maps = JDBCUtil.queryMap(sql);
        return maps;
    }
/*    public static void main(String[] args) {
        String sql="select bookid from t_book";
        List<List> lists = JDBCUtil.queryList(sql);
        System.out.println(lists.size());
*//*
         String sql="select * from t_book";
        List<Map> maps = JDBCUtil.queryMap(sql);
        System.out.println(maps);*//*
    }*/
}
